/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-  */
/*
 * catchit
 * Copyright (C) 2013 Ryan Grinkewitz <graphite@Toto>
 * 
 */

#include "platform.h"


Platform::Platform(int platformLocation){
	this->platformLocation = platformLocation;
	spriteIds[0] = 2;
	spriteIds[1] = 3;

	collisionBox = new SDL_Rect();
	collisionBox->x = PLATFORM_WIDTH * platformLocation + PLATFORM_X_OFFSET;
	collisionBox->y = 0;
	collisionBox->w = PLATFORM_WIDTH;
	collisionBox->h = PLATFORM_HEIGHT;	
}

Platform::~Platform(){
	delete collisionBox;
}

int* Platform::getSpriteIds(){
	return spriteIds;
}

void Platform::setSpriteIds(int sprite1, int sprite2){
	spriteIds[0] = sprite1;
	spriteIds[1] = sprite2;
}   

void Platform::setPlatformYPosition(int platformYPosition){
	this->platformYPosition = platformYPosition;
	collisionBox->y = platformYPosition + PLATFORM_Y_OFFSET;
}

int Platform::getPlatformYPosition(){
	return platformYPosition;
}

void Platform::setPlatformXPosition(int platformXPosition){
	this->platformXPosition = platformXPosition;
}

int Platform::getPlatformXPosition(){
	return platformXPosition;
}

SDL_Rect* Platform::getCollisionBox(){
	return collisionBox;
}